from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo.tools import float_compare, float_is_zero
from odoo.tools.misc import clean_context


class RmaScrapLine(models.Model):
    _name = 'rma.scrap.line'
    _description = 'RMA Scrap Line'  # 报废明细

    rma_id = fields.Many2one('rma', "RMA Order")
    scrapreason_id = fields.Many2one('scrap.reason', string="Discard Reason",
                                     ondelete='restrict', required=True, index=True)
    qty_reject = fields.Float(string='Discard Qty')
